'use strict';

/**
 * @ngdoc function
 * @name consoleAngularUiApp.service:sercurityRoute
 * @description
 * # sercurityRouteServ
 * SercurityRoute service of the consoleAngularUiApp
 */
angular.module('consoleAngularUiApp')
  .provider('$sercurityRouteProvider', ['$stateProvider', '$urlRouterProvider', function ($stateProvider, $urlRouterProvider) {

		var html5Mode = false, stateList = [], urlList = [], unmatchRedirectUrl;

		this.useHtml5Mode = function (val) {
			html5Mode = !!val;
			return this;
		}

		this.importStateList = function (list) {
			if (!(list instanceof Array)) {
				throw new Error('state list you are importing is not Array');
			}
			stateList = list;
			return this;
		}

		this.unmatchRedirect = function (url) {
			if (!url) {
				throw new Error('You must specify an url string');
			}
			unmatchRedirectUrl = url.toString().trim();
			return this;
		}

		this.$get = function () {
			return {
				useHtml5Mode: html5Mode,
				states: stateList
			}
		}
	}])
	.service('$securityRouteServ', ['$plUtils', '$sercurityRouteProvider', function($plUtils, $sercurityRouteProvider){

		this.init = function () {

		}

		this.start = function () {

		}

		this.stop = function () {

		}

		this.addState = function () {

		}

		this.removeState = function () {

		}

	}])
